<template>
	<div class="questions">
		
		<div class="questions-div">
			
			<div class="questions-body">
				<div class="tr"  v-for="(item,index) in body">
					<div class="tr-div"
						:style="{'background':twoitem.ticolor}"
						v-for="(twoitem,twoindex) in item"
						:class="{
							'tr-right' : (index==0 || index==1  || index==3  || index==4  || index==6 ||index == 7 ||index == 8) && (twoindex ==2 || twoindex ==5),
							'tr-below' : (index==2 || index==5) && (twoindex !=2 || twoindex !=5),
							'tr-rightbelow' : (index==2 || index==5) && (twoindex ==2 || twoindex == 5),				
						}"
					>
						<div class="hint" v-if="twoitem.leftnumber > 0">{{twoitem.leftnumber}}</div>
						<div class="dotted lefttop" v-if="twoitem.direction  == 'lefttop1'"></div>
						<div class="dotted righttop" v-if="twoitem.direction  == 'righttop1'"></div>
						<div class="dotted leftbuttom" v-if="twoitem.direction  == 'leftbuttom1'"></div>
						<div class="dotted rightbuttom" v-if="twoitem.direction  == 'rightbuttom1'"></div>
						<div class="dotted lefttopbuttom" v-if="twoitem.direction  == 'lefttopbuttom1'"></div>
						<div class="dotted righttopbuttom" v-if="twoitem.direction  == 'righttopbuttom1'"></div>
						<div class="dotted lefttopright" v-if="twoitem.direction  == 'lefttopright1'"></div>
						<div class="dotted leftbuttomright" v-if="twoitem.direction  == 'leftbuttomright1'"></div>
						<div class="dotted center" v-if="twoitem.direction  == 'center1'"></div>
						<div class="dotted verticalcenter" v-if="twoitem.direction  == 'verticalcenter1'"></div>
						<div class="dotted topcenter" v-if="twoitem.direction  == 'topcenter1'"></div>
						
						
						<input type="number"  disabled  v-if="twoitem.type==0"  v-model="twoitem.value" />
							<input type="number"
							 :class="index == xindex && twoindex == xindex1  ? 'bagcolor': ''"
							 class="pitchon " @click="userinputClick(index,twoindex)"  disabled  v-if="twoitem.type==1 && bijishow == 0"  v-model="twoitem.uservalue" />
						<view class="bijique" v-if="twoitem.type==1 && bijishow == 1" @click="userinputClick(index,twoindex)"  :class="index == xindex && twoindex == xindex1  ? 'bagcolor': ''">
							<view v-for="(item,index) in twoitem.biji">{{item}}</view>	
						</view>	
					</div>
					
				</div>
			</div>
		</div>
		
		
	</div>
</template>
<!-- 
	方向  direction
	img   虚线
	leftnumber 数字
 -->
<script>
	export default {
		props: ['body','bijishow'],
		watch:{
			body(e){
				this.body  = e;
			}
		},
		data() {
			return {
				type : 0, 
				xindex : null,
				xindex1 : null
				
			}
		},
		created() {
			console.log(this.body);
		},
		methods:{
			userinputClick(index,index1){
				this.xindex = index;
				this.xindex1 = index1;
				this.$emit('userinputChange',{'index':index,'index1':index1});
			},
			
		}
		
	}
</script>

<style >
	@import url("@/common/css/questions.css");
	@import url("@/common/css/killer.css");
	
	.questions {
		display: flex;	
		
	}
	.questions-div {
		width: 738rpx;
		height: 780rpx;
		margin: auto;
	}
	.questions-body {
		width: 738rpx;
		height: 738rpx;
		border: 2rpx solid #000;
		box-shadow: inset 2rpx 2rpx 0 #e3e4e5;
		display: flex;
		flex-direction: column;
	}
	.tr {
		display: flex;
		flex: 1;
	}
	
	.tr-div > input {
		position: absolute;
		z-index: 12;
		top: 0;
	}
	.bagcolor {
		background-color: #edff38 !important;
		width: 98% !important;
		height: 98% !important;
	}
	
</style>